3.13 \(\int \frac{(a+b x)^2 \sin (c+d x)}{x} \, dx\)

Optimal. Leaf size=62 \[ a^2 \sin (c) \text{CosIntegral}(d x)+a^2 \cos (c) \text{Si}(d x)-\frac{2 a b \cos (c+d x)}{d}+\frac{b^2 \sin (c+d x)}{d^2}-\frac{b^2 x \cos (c+d x)}{d} \]

[Out]

(-2*a*b*Cos[c + d*x])/d - (b^2*x*Cos[c + d*x])/d + a^2*CosIntegral[d*x]*Sin[c] + (b^2*Sin[c + d*x])/d^2 + a^2*
Cos[c]*SinIntegral[d*x]

________________________________________________________________________________________

Rubi [A]  time = 0.182651, antiderivative size = 62, normalized size of antiderivative = 1., number of steps used = 8, number of rules used = 7, integrand size = 17, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.412, Rules used = {6742, 2638, 3303, 3299, 3302, 3296, 2637} \[ a^2 \sin (c) \text{CosIntegral}(d x)+a^2 \cos (c) \text{Si}(d x)-\frac{2 a b \cos (c+d x)}{d}+\frac{b^2 \sin (c+d x)}{d^2}-\frac{b^2 x \cos (c+d x)}{d} \]

Antiderivative was successfully verified.

[In]

Int[((a + b*x)^2*Sin[c + d*x])/x,x]

[Out]

(-2*a*b*Cos[c + d*x])/d - (b^2*x*Cos[c + d*x])/d + a^2*CosIntegral[d*x]*Sin[c] + (b^2*Sin[c + d*x])/d^2 + a^2*
Cos[c]*SinIntegral[d*x]

Rule 6742

Int[u_, x_Symbol] :> With[{v = ExpandIntegrand[u, x]}, Int[v, x] /; SumQ[v]]

Rule 2638

Int[sin[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[Cos[c + d*x]/d, x] /; FreeQ[{c, d}, x]

Rule 3303

Int[sin[(e_.) + (f_.)*(x_)]/((c_.) + (d_.)*(x_)), x_Symbol] :> Dist[Cos[(d*e - c*f)/d], Int[Sin[(c*f)/d + f*x]
/(c + d*x), x], x] + Dist[Sin[(d*e - c*f)/d], Int[Cos[(c*f)/d + f*x]/(c + d*x), x], x] /; FreeQ[{c, d, e, f},
x] && NeQ[d*e - c*f, 0]

Rule 3299

Int[sin[(e_.) + (f_.)*(x_)]/((c_.) + (d_.)*(x_)), x_Symbol] :> Simp[SinIntegral[e + f*x]/d, x] /; FreeQ[{c, d,
 e, f}, x] && EqQ[d*e - c*f, 0]

Rule 3302

Int[sin[(e_.) + (f_.)*(x_)]/((c_.) + (d_.)*(x_)), x_Symbol] :> Simp[CosIntegral[e - Pi/2 + f*x]/d, x] /; FreeQ
[{c, d, e, f}, x] && EqQ[d*(e - Pi/2) - c*f, 0]

Rule 3296

Int[((c_.) + (d_.)*(x_))^(m_.)*sin[(e_.) + (f_.)*(x_)], x_Symbol] :> -Simp[((c + d*x)^m*Cos[e + f*x])/f, x] +
Dist[(d*m)/f, Int[(c + d*x)^(m - 1)*Cos[e + f*x], x], x] /; FreeQ[{c, d, e, f}, x] && GtQ[m, 0]

Rule 2637

Int[sin[Pi/2 + (c_.) + (d_.)*(x_)], x_Symbol] :> Simp[Sin[c + d*x]/d, x] /; FreeQ[{c, d}, x]

Rubi steps

\begin{align*} \int \frac{(a+b x)^2 \sin (c+d x)}{x} \, dx &=\int \left (2 a b \sin (c+d x)+\frac{a^2 \sin (c+d x)}{x}+b^2 x \sin (c+d x)\right ) \, dx\\ &=a^2 \int \frac{\sin (c+d x)}{x} \, dx+(2 a b) \int \sin (c+d x) \, dx+b^2 \int x \sin (c+d x) \, dx\\ &=-\frac{2 a b \cos (c+d x)}{d}-\frac{b^2 x \cos (c+d x)}{d}+\frac{b^2 \int \cos (c+d x) \, dx}{d}+\left (a^2 \cos (c)\right ) \int \frac{\sin (d x)}{x} \, dx+\left (a^2 \sin (c)\right ) \int \frac{\cos (d x)}{x} \, dx\\ &=-\frac{2 a b \cos (c+d x)}{d}-\frac{b^2 x \cos (c+d x)}{d}+a^2 \text{Ci}(d x) \sin (c)+\frac{b^2 \sin (c+d x)}{d^2}+a^2 \cos (c) \text{Si}(d x)\\ \end{align*}

Mathematica [A]  time = 0.287847, size = 51, normalized size = 0.82 \[ a^2 \sin (c) \text{CosIntegral}(d x)+a^2 \cos (c) \text{Si}(d x)+\frac{b (b \sin (c+d x)-d (2 a+b x) \cos (c+d x))}{d^2} \]

Antiderivative was successfully verified.

[In]

Integrate[((a + b*x)^2*Sin[c + d*x])/x,x]

[Out]

a^2*CosIntegral[d*x]*Sin[c] + (b*(-(d*(2*a + b*x)*Cos[c + d*x]) + b*Sin[c + d*x]))/d^2 + a^2*Cos[c]*SinIntegra
l[d*x]

________________________________________________________________________________________

Maple [A]  time = 0.01, size = 79, normalized size = 1.3 \begin{align*}{\frac{ \left ( 1+c \right ){b}^{2} \left ( \sin \left ( dx+c \right ) - \left ( dx+c \right ) \cos \left ( dx+c \right ) \right ) }{{d}^{2}}}-2\,{\frac{ab\cos \left ( dx+c \right ) }{d}}+2\,{\frac{c{b}^{2}\cos \left ( dx+c \right ) }{{d}^{2}}}+{a}^{2} \left ({\it Si} \left ( dx \right ) \cos \left ( c \right ) +{\it Ci} \left ( dx \right ) \sin \left ( c \right ) \right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((b*x+a)^2*sin(d*x+c)/x,x)

[Out]

(1+c)/d^2*b^2*(sin(d*x+c)-(d*x+c)*cos(d*x+c))-2*a*b*cos(d*x+c)/d+2*c/d^2*b^2*cos(d*x+c)+a^2*(Si(d*x)*cos(c)+Ci
(d*x)*sin(c))

________________________________________________________________________________________

Maxima [C]  time = 2.09114, size = 108, normalized size = 1.74 \begin{align*} \frac{{\left (a^{2}{\left (-i \,{\rm Ei}\left (i \, d x\right ) + i \,{\rm Ei}\left (-i \, d x\right )\right )} \cos \left (c\right ) + a^{2}{\left ({\rm Ei}\left (i \, d x\right ) +{\rm Ei}\left (-i \, d x\right )\right )} \sin \left (c\right )\right )} d^{2} + 2 \, b^{2} \sin \left (d x + c\right ) - 2 \,{\left (b^{2} d x + 2 \, a b d\right )} \cos \left (d x + c\right )}{2 \, d^{2}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*x+a)^2*sin(d*x+c)/x,x, algorithm="maxima")

[Out]

1/2*((a^2*(-I*Ei(I*d*x) + I*Ei(-I*d*x))*cos(c) + a^2*(Ei(I*d*x) + Ei(-I*d*x))*sin(c))*d^2 + 2*b^2*sin(d*x + c)
 - 2*(b^2*d*x + 2*a*b*d)*cos(d*x + c))/d^2

________________________________________________________________________________________

Fricas [A]  time = 1.64999, size = 230, normalized size = 3.71 \begin{align*} \frac{2 \, a^{2} d^{2} \cos \left (c\right ) \operatorname{Si}\left (d x\right ) + 2 \, b^{2} \sin \left (d x + c\right ) - 2 \,{\left (b^{2} d x + 2 \, a b d\right )} \cos \left (d x + c\right ) +{\left (a^{2} d^{2} \operatorname{Ci}\left (d x\right ) + a^{2} d^{2} \operatorname{Ci}\left (-d x\right )\right )} \sin \left (c\right )}{2 \, d^{2}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*x+a)^2*sin(d*x+c)/x,x, algorithm="fricas")

[Out]

1/2*(2*a^2*d^2*cos(c)*sin_integral(d*x) + 2*b^2*sin(d*x + c) - 2*(b^2*d*x + 2*a*b*d)*cos(d*x + c) + (a^2*d^2*c
os_integral(d*x) + a^2*d^2*cos_integral(-d*x))*sin(c))/d^2

________________________________________________________________________________________

Sympy [A]  time = 3.75537, size = 90, normalized size = 1.45 \begin{align*} a^{2} \sin{\left (c \right )} \operatorname{Ci}{\left (d x \right )} + a^{2} \cos{\left (c \right )} \operatorname{Si}{\left (d x \right )} + 2 a b \left (\begin{cases} - \cos{\left (c \right )} & \text{for}\: d = 0 \\- \frac{\cos{\left (c + d x \right )}}{d} & \text{otherwise} \end{cases}\right ) + b^{2} x \left (\begin{cases} - \cos{\left (c \right )} & \text{for}\: d = 0 \\- \frac{\cos{\left (c + d x \right )}}{d} & \text{otherwise} \end{cases}\right ) - b^{2} \left (\begin{cases} - x \cos{\left (c \right )} & \text{for}\: d = 0 \\- \frac{\begin{cases} \frac{\sin{\left (c + d x \right )}}{d} & \text{for}\: d \neq 0 \\x \cos{\left (c \right )} & \text{otherwise} \end{cases}}{d} & \text{otherwise} \end{cases}\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*x+a)**2*sin(d*x+c)/x,x)

[Out]

a**2*sin(c)*Ci(d*x) + a**2*cos(c)*Si(d*x) + 2*a*b*Piecewise((-cos(c), Eq(d, 0)), (-cos(c + d*x)/d, True)) + b*
*2*x*Piecewise((-cos(c), Eq(d, 0)), (-cos(c + d*x)/d, True)) - b**2*Piecewise((-x*cos(c), Eq(d, 0)), (-Piecewi
se((sin(c + d*x)/d, Ne(d, 0)), (x*cos(c), True))/d, True))

________________________________________________________________________________________

Giac [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: TypeError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*x+a)^2*sin(d*x+c)/x,x, algorithm="giac")

[Out]

Exception raised: TypeError